/**
 * <copyright>
 *
 * Copyright (c) 2011 Zeligsoft (2009) Limited
 * All rights reserved.   This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors: 
 *   Zeligsoft (2009) Limited - Initial API and implementation
 *
 * </copyright>
 *
 */
package org.omg.deployment.impl;

import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.util.FeatureMap;
import org.omg.deployment.AliasType;
import org.omg.deployment.ArrayType;
import org.omg.deployment.BoundedStringType;
import org.omg.deployment.DataType;
import org.omg.deployment.DeploymentPackage;
import org.omg.deployment.EnumType;
import org.omg.deployment.FixedType;
import org.omg.deployment.ObjrefType;
import org.omg.deployment.SequenceType;
import org.omg.deployment.StructType;
import org.omg.deployment.TCKind;
import org.omg.deployment.UnionType;
import org.omg.deployment.ValueType;
import org.omg.xmi.impl.XMIImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Data Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getKind <em>Kind</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getEnum <em>Enum</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getObjref <em>Objref</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getBoundedString <em>Bounded String</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getFixed <em>Fixed</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getArray <em>Array</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getSequence <em>Sequence</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getAlias <em>Alias</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getStruct <em>Struct</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getValue <em>Value</em>}</li>
 *   <li>{@link org.omg.deployment.impl.DataTypeImpl#getUnion <em>Union</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DataTypeImpl extends XMIImpl implements DataType {
	/**
	 * The default value of the '{@link #getKind() <em>Kind</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getKind()
	 * @generated
	 * @ordered
	 */
	protected static final TCKind KIND_EDEFAULT = TCKind.TK_NULL;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DataTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return DeploymentPackage.eINSTANCE.getDataType();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TCKind getKind() {
		return (TCKind) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Kind(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setKind(TCKind newKind) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Kind(), newKind);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EnumType getEnum() {
		return (EnumType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Enum(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetEnum(EnumType newEnum,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup()).basicAdd(
				DeploymentPackage.eINSTANCE.getDataType_Enum(), newEnum, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setEnum(EnumType newEnum) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Enum(), newEnum);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ObjrefType getObjref() {
		return (ObjrefType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Objref(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetObjref(ObjrefType newObjref,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup()).basicAdd(
				DeploymentPackage.eINSTANCE.getDataType_Objref(), newObjref,
				msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setObjref(ObjrefType newObjref) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Objref(), newObjref);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public BoundedStringType getBoundedString() {
		return (BoundedStringType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_BoundedString(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetBoundedString(
			BoundedStringType newBoundedString, NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup()).basicAdd(
				DeploymentPackage.eINSTANCE.getDataType_BoundedString(),
				newBoundedString, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBoundedString(BoundedStringType newBoundedString) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_BoundedString(),
				newBoundedString);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public FixedType getFixed() {
		return (FixedType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Fixed(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetFixed(FixedType newFixed,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup())
				.basicAdd(DeploymentPackage.eINSTANCE.getDataType_Fixed(),
						newFixed, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFixed(FixedType newFixed) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Fixed(), newFixed);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ArrayType getArray() {
		return (ArrayType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Array(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetArray(ArrayType newArray,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup())
				.basicAdd(DeploymentPackage.eINSTANCE.getDataType_Array(),
						newArray, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setArray(ArrayType newArray) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Array(), newArray);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SequenceType getSequence() {
		return (SequenceType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Sequence(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetSequence(SequenceType newSequence,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup()).basicAdd(
				DeploymentPackage.eINSTANCE.getDataType_Sequence(),
				newSequence, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setSequence(SequenceType newSequence) {
		((FeatureMap.Internal) getGroup())
				.set(DeploymentPackage.eINSTANCE.getDataType_Sequence(),
						newSequence);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AliasType getAlias() {
		return (AliasType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Alias(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetAlias(AliasType newAlias,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup())
				.basicAdd(DeploymentPackage.eINSTANCE.getDataType_Alias(),
						newAlias, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAlias(AliasType newAlias) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Alias(), newAlias);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public StructType getStruct() {
		return (StructType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Struct(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetStruct(StructType newStruct,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup()).basicAdd(
				DeploymentPackage.eINSTANCE.getDataType_Struct(), newStruct,
				msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setStruct(StructType newStruct) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Struct(), newStruct);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ValueType getValue() {
		return (ValueType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Value(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetValue(ValueType newValue,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup())
				.basicAdd(DeploymentPackage.eINSTANCE.getDataType_Value(),
						newValue, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setValue(ValueType newValue) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Value(), newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public UnionType getUnion() {
		return (UnionType) getGroup().get(
				DeploymentPackage.eINSTANCE.getDataType_Union(), true);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetUnion(UnionType newUnion,
			NotificationChain msgs) {
		return ((FeatureMap.Internal) getGroup())
				.basicAdd(DeploymentPackage.eINSTANCE.getDataType_Union(),
						newUnion, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setUnion(UnionType newUnion) {
		((FeatureMap.Internal) getGroup()).set(
				DeploymentPackage.eINSTANCE.getDataType_Union(), newUnion);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd,
			int featureID, NotificationChain msgs) {
		switch (featureID) {
		case DeploymentPackage.DATA_TYPE__ENUM:
			return basicSetEnum(null, msgs);
		case DeploymentPackage.DATA_TYPE__OBJREF:
			return basicSetObjref(null, msgs);
		case DeploymentPackage.DATA_TYPE__BOUNDED_STRING:
			return basicSetBoundedString(null, msgs);
		case DeploymentPackage.DATA_TYPE__FIXED:
			return basicSetFixed(null, msgs);
		case DeploymentPackage.DATA_TYPE__ARRAY:
			return basicSetArray(null, msgs);
		case DeploymentPackage.DATA_TYPE__SEQUENCE:
			return basicSetSequence(null, msgs);
		case DeploymentPackage.DATA_TYPE__ALIAS:
			return basicSetAlias(null, msgs);
		case DeploymentPackage.DATA_TYPE__STRUCT:
			return basicSetStruct(null, msgs);
		case DeploymentPackage.DATA_TYPE__VALUE:
			return basicSetValue(null, msgs);
		case DeploymentPackage.DATA_TYPE__UNION:
			return basicSetUnion(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case DeploymentPackage.DATA_TYPE__KIND:
			return getKind();
		case DeploymentPackage.DATA_TYPE__ENUM:
			return getEnum();
		case DeploymentPackage.DATA_TYPE__OBJREF:
			return getObjref();
		case DeploymentPackage.DATA_TYPE__BOUNDED_STRING:
			return getBoundedString();
		case DeploymentPackage.DATA_TYPE__FIXED:
			return getFixed();
		case DeploymentPackage.DATA_TYPE__ARRAY:
			return getArray();
		case DeploymentPackage.DATA_TYPE__SEQUENCE:
			return getSequence();
		case DeploymentPackage.DATA_TYPE__ALIAS:
			return getAlias();
		case DeploymentPackage.DATA_TYPE__STRUCT:
			return getStruct();
		case DeploymentPackage.DATA_TYPE__VALUE:
			return getValue();
		case DeploymentPackage.DATA_TYPE__UNION:
			return getUnion();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case DeploymentPackage.DATA_TYPE__KIND:
			setKind((TCKind) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__ENUM:
			setEnum((EnumType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__OBJREF:
			setObjref((ObjrefType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__BOUNDED_STRING:
			setBoundedString((BoundedStringType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__FIXED:
			setFixed((FixedType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__ARRAY:
			setArray((ArrayType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__SEQUENCE:
			setSequence((SequenceType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__ALIAS:
			setAlias((AliasType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__STRUCT:
			setStruct((StructType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__VALUE:
			setValue((ValueType) newValue);
			return;
		case DeploymentPackage.DATA_TYPE__UNION:
			setUnion((UnionType) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
		case DeploymentPackage.DATA_TYPE__KIND:
			setKind(KIND_EDEFAULT);
			return;
		case DeploymentPackage.DATA_TYPE__ENUM:
			setEnum((EnumType) null);
			return;
		case DeploymentPackage.DATA_TYPE__OBJREF:
			setObjref((ObjrefType) null);
			return;
		case DeploymentPackage.DATA_TYPE__BOUNDED_STRING:
			setBoundedString((BoundedStringType) null);
			return;
		case DeploymentPackage.DATA_TYPE__FIXED:
			setFixed((FixedType) null);
			return;
		case DeploymentPackage.DATA_TYPE__ARRAY:
			setArray((ArrayType) null);
			return;
		case DeploymentPackage.DATA_TYPE__SEQUENCE:
			setSequence((SequenceType) null);
			return;
		case DeploymentPackage.DATA_TYPE__ALIAS:
			setAlias((AliasType) null);
			return;
		case DeploymentPackage.DATA_TYPE__STRUCT:
			setStruct((StructType) null);
			return;
		case DeploymentPackage.DATA_TYPE__VALUE:
			setValue((ValueType) null);
			return;
		case DeploymentPackage.DATA_TYPE__UNION:
			setUnion((UnionType) null);
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case DeploymentPackage.DATA_TYPE__KIND:
			return getKind() != KIND_EDEFAULT;
		case DeploymentPackage.DATA_TYPE__ENUM:
			return getEnum() != null;
		case DeploymentPackage.DATA_TYPE__OBJREF:
			return getObjref() != null;
		case DeploymentPackage.DATA_TYPE__BOUNDED_STRING:
			return getBoundedString() != null;
		case DeploymentPackage.DATA_TYPE__FIXED:
			return getFixed() != null;
		case DeploymentPackage.DATA_TYPE__ARRAY:
			return getArray() != null;
		case DeploymentPackage.DATA_TYPE__SEQUENCE:
			return getSequence() != null;
		case DeploymentPackage.DATA_TYPE__ALIAS:
			return getAlias() != null;
		case DeploymentPackage.DATA_TYPE__STRUCT:
			return getStruct() != null;
		case DeploymentPackage.DATA_TYPE__VALUE:
			return getValue() != null;
		case DeploymentPackage.DATA_TYPE__UNION:
			return getUnion() != null;
		}
		return super.eIsSet(featureID);
	}

} //DataTypeImpl
